package hut.lgl.service;

import hut.lgl.bean.Book;
import hut.lgl.dao.BookDao;

import java.util.List;

public class BookService {
    private BookDao bookDao = new BookDao();

    //修改图书
    public int updateBook(Book book){
        return bookDao.updateBook(book);
    }

    //删除图书
    public int deleteBook(int bid){
        return bookDao.deleteBook(bid);
    }

    //根据bid查询图书
    public Book getBookById(int bid){
        return bookDao.getBookById(bid);
    }

    //添加图书
    public int addBook(Book book){
        return bookDao.addBook(book);
    }

    //查看所有图书
    public List<Book> getAllBooks(){
        return bookDao.getAallBooks();
    }
}
